package com.home.service.impl;


import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.home.common.Page;
import com.home.dao.HomeDAO;
import com.home.model.Home;
import com.home.model.QueryHome;
import com.home.service.HomeService;
@Service("homeService")
public class HomeServiceImpl implements HomeService {
	
	@Autowired
	private HomeDAO homeDAO;
	
	public void deleteHomeById(Integer id) {
		this.getHomeDAO().delete(id);
	}

	public Home getHomeById(Integer id) {
		return this.getHomeDAO().get(id);
	}

	public void insert(Home h) {
		this.getHomeDAO().save(h);
	}

	public void setHomeDAO(HomeDAO homeDAO) {
		this.homeDAO = homeDAO;
	}

	public HomeDAO getHomeDAO() {
		return homeDAO;
	}

	public Page<Home> getAll(Page<Home> p) {
		
		Page<Home> page = this.getHomeDAO().getAll(p);
		return page;
	}

	public Page<Home> getHomeByConditions(Page<Home> p, Map<String, Object> map) {
		return null;
	}

	public Page<Home> getHome(Page<Home> page, QueryHome home) {
		return this.getHomeDAO().getHome(page, home);
	}


}
